// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Dust Puff Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 19 : TYPE_DUSTPUFF


// Static Values

// Tables

event ObjectMain
	object.xpos += object.xvel
	object.ypos += object.yvel
	switch object.frame
	case 0
	case 1
	case 2
		object.animationTimer++
		if object.animationTimer > 3
			object.frame++
			object.animationTimer = 0
		end if
		break
	case 3
		object.animationTimer++
		if object.animationTimer > 3
			object.type = TypeName[Blank Object]
		end if
		break
	case 4
	case 5
	case 6
	case 7
	case 8
	case 9
		object.animationTimer++
		if object.animationTimer > 1
			object.frame++
			object.animationTimer = 0
		end if
		break
	case 10
		object.animationTimer++
		if object.animationTimer > 1
			object.frame = 4
			object.animationTimer = 0
		end if
		break
	case 11
	case 12
	case 13
	case 14
	case 15
	case 16
	case 17
		object.animationTimer++
		if object.animationTimer > 3
			object.frame++
			object.animationTimer = 0
		end if
		break
	case 18
		object.animationTimer++
		if object.animationTimer > 3
			object.type = TypeName[Blank Object]
		end if
	end switch
end event


event ObjectDraw
	switch object.frame
	case 4
	case 5
	case 6
	case 7
	case 8
	case 9
	case 10
		currentPlayer = object.propertyValue
		object.direction = object[currentPlayer].direction
		object.xpos = object[currentPlayer].xpos
		object.iypos = object[currentPlayer].collisionBottom
		object.ypos += object[currentPlayer].ypos
		if object[currentPlayer].animation != ANI_SPINDASH
			object.type = TypeName[Blank Object]
		else
			DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
		end if
		break
	default
		DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
		break
	end switch
end event


event ObjectStartup
	LoadSpriteSheet("Global/KnuxGreyShield.gif")
	SpriteFrame(-7, -11, 13, 14, 138, 1)
	SpriteFrame(-7, -11, 13, 14, 152, 1)
	SpriteFrame(-6, -11, 13, 14, 166, 1)
	SpriteFrame(-7, -11, 13, 14, 180, 1)
	
	SpriteFrame(-32, -10, 32, 10, 138, 16)
	SpriteFrame(-32, -12, 32, 12, 171, 16)
	SpriteFrame(-32, -16, 32, 16, 171, 29)
	SpriteFrame(-32, -18, 32, 18, 138, 27)
	SpriteFrame(-32, -20, 32, 20, 118, 46)
	SpriteFrame(-32, -21, 32, 21, 151, 46)
	SpriteFrame(-32, -23, 32, 23, 184, 46)
	
	SpriteFrame(-19, -9, 19, 9, 1, 1)
	SpriteFrame(-23, -16, 20, 16, 21, 1)
	SpriteFrame(-25, -19, 21, 19, 42, 1)
	SpriteFrame(-24, -20, 22, 20, 64, 1)
	SpriteFrame(-25, -21, 24, 21, 87, 1)
	SpriteFrame(-24, -26, 24, 26, 112, 1) 
	SpriteFrame(-22, -24, 25, 21, 59, 22)
	SpriteFrame(-18, -20, 22, 18, 62, 44)
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
